from django.db import models


# Create your models here.

class Host(models.Model):

    bk_biz_id = models.IntegerField()
    ip = models.CharField(max_length=255, null=False, blank=False)
    user = models.CharField(max_length=255, null=False, blank=False)
    create_time = models.DateTimeField(auto_now_add=True)

    class Meta:
        ordering = ['-id']


class HostStat(models.Model):
    bk_biz_id = models.IntegerField()
    ip = models.CharField(max_length=255, null=False, blank=False)
    cpu = models.FloatField()
    mem = models.FloatField()
    disk = models.FloatField()
    monitor_time = models.CharField(max_length=64, null=True, blank=True)
    create_time = models.DateTimeField(auto_now_add=True)
    
    class Meta:
        ordering = ['-id']


class History(models.Model):
    ip = models.CharField(max_length=255, null=False, blank=False)
    user = models.CharField(max_length=255, null=False, blank=False)
    create_time = models.DateTimeField(auto_now_add=True)
    action = models.CharField(max_length=255, null=False, blank=False)

    class Meta:
        ordering = ['-id']